package com.qyhl.shop.shop.center.coupon;

import com.qyhl.webtv.commonlib.entity.shop.ShopCenterCouponBean;

import java.util.List;

public class ShopCenterCouponListPresenter implements ShopCenterCouponListContract.ShopCenterCouponListPresenter {
    private ShopCenterCouponListContract.ShopCenterCouponListView mView;
    private ShopCenterCouponListModel mModel;

    public ShopCenterCouponListPresenter(ShopCenterCouponListContract.ShopCenterCouponListView mView) {
        this.mView = mView;
        this.mModel = new ShopCenterCouponListModel(this);
    }

    @Override
    public void getList(int type, int page, String phoneNum) {
        mModel.getList(type, page, phoneNum);
    }

    @Override
    public void setList(List<ShopCenterCouponBean> beanList) {
        if (beanList == null || beanList.size() < 1) {
            mView.setList(null);
        } else {
            mView.setList(beanList);
        }
    }

    @Override
    public void setError(String msg) {
        mView.setError(msg);
    }
}
